<template>
  <div>
    <el-table
      :data="auditList"
      style="width: 100%"
      height="250">
      <el-table-column fixed prop="auditDate" label="审请时间" width="150">
      </el-table-column>
      <el-table-column prop="productName" label="药品名称" width="150">
      </el-table-column>
      <el-table-column prop="medicineType" label="药品类型" width="150">
      </el-table-column>
      <el-table-column prop="manufacturer" label="药品制造商" width="150">
      </el-table-column>
      <el-table-column prop="specification" label="药品规格" width="120">
      </el-table-column>
      <el-table-column prop="medicineUnit" label="药品单位" width="150">
      </el-table-column>
      <el-table-column prop="price" label="药品价格" width="150">
      </el-table-column>
      <el-table-column prop="shelfLife" label="生产日期" width="150">
      </el-table-column>
      <el-table-column prop="upToTime" label="截至日期" width="150">
      </el-table-column>
      <el-table-column prop="medicineUnit" label="药品单位" width="150">
      </el-table-column>
      <el-table-column prop="tradeChart" label="药品图" width="150">
      </el-table-column>
      <el-table-column prop="inventory" label="库存数量" width="150">
      </el-table-column>
      <el-table-column prop="drugDescription" label="药品描述" width="150">
      </el-table-column>
      <el-table-column prop="auditStatus" label="审核状态" width="150">
      </el-table-column>
      <el-table-column prop="comments" label="审核信息" width="150">
      </el-table-column>
      <el-table-column prop="controls" label="操作" width="180">
        <template slot-scope="scope">
          <el-button icon="el-icon-edit" type="text" @click="handleEdit(scope.row)">查看详情</el-button>
        </template>
      </el-table-column>

      <el-pagination
        background
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="PageNum"
        :page-sizes="[5, 6, 7, 8]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total">
      </el-pagination>
    </el-table>
  </div>
</template>


<script>
import {drugAuditList, viewDetails} from "@/api/drugAudit/drugAudit";

export default {
  name: "drugAudit",
  data() {
    return {
      auditList:[],
      pageSize: 5,
      total: 0,
      PageNum: 1,
    }
  },
  methods: {
    //
    // //新增
    // drugAudit(){
    //   drugAuditList().then((res)=>{
    //     console.log(res)
    //   })
    // },
    //查所有审核记录
    viewDetails(){
      viewDetails({
        PageNum:this.PageNum,
        pageSize:this.pageSize,
      }).then((res)=>{
        console.log(res)
        this.auditList=res.data.list
      })
    },
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      this.pageSize = val;
      this.viewDetails()
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.PageNum = val;
      this.viewDetails()
    },
  },
  created() {
    this.viewDetails()
  }
}
</script>

<style scoped lang="scss">

</style>
